From 00f94cb865752a227f25f7f37bff561fb81cfb02 Mon Sep 17 00:00:00 2001 From: Chris Wong Date: Tue, 24 Feb 2015 20:44:33 +1300 Subject: [PATCH] Use an underscore instead of a hyphen as a dummy crate name Closes #1342. --- src/cargo/ops/cargo_rustc/context.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cargo/ops/cargo_rustc/context.rs b/src/cargo/ops/cargo_rustc/context.rs index f9e562cc8..040ba759e 100644 --- a/src/cargo/ops/cargo_rustc/context.rs +++ b/src/cargo/ops/cargo_rustc/context.rs @@ -92,7 +92,7 @@ impl<'a, 'b: 'a> Context<'a, 'b> { -> CargoResult<(Option<(String, String)>, String)> { let process = try!(util::process("rustc")) .arg("-") - .arg("--crate-name").arg("-") + .arg("--crate-name").arg("_") .arg("--crate-type").arg("dylib") .arg("--crate-type").arg("bin") .arg("--print=file-names"); @@ -111,7 +111,7 @@ impl<'a, 'b: 'a> Context<'a, 'b> { None } else { let dylib_parts: Vec<&str> = lines.next().unwrap().trim() - .split('-').collect(); + .split('_').collect(); assert!(dylib_parts.len() == 2, "rustc --print-file-name output has changed"); Some((dylib_parts[0].to_string(), dylib_parts[1].to_string())) @@ -121,7 +121,7 @@ impl<'a, 'b: 'a> Context<'a, 'b> { String::new() } else { lines.next().unwrap().trim() - .split('-').skip(1).next().unwrap().to_string() + .split('_').skip(1).next().unwrap().to_string() }; Ok((dylib, exe_suffix.to_string())) } -- 2.30.2